Add initial implementation of delay information views.#2634
Conversation
|
|
||
| // MARK: - Delay Information | ||
|
|
||
| extension NavigationMapView { |
There was a problem hiding this comment.
Since NavigationMapView now contains several features we can expose them as separate extension files (e.g. for route lines, building highlighting, vanishing route line, delay information).
| @@ -0,0 +1,34 @@ | |||
| import UIKit | |||
|
|
|||
| class DelayInformationView: UIView { | |||
There was a problem hiding this comment.
I don't really like creating DelayInformationView which is then later converted to UIImage so that it's possible to use it in MGLSymbolStyleLayer (there are some additional issues like text overlapping etc).
On the other hand seems that MGLPointAnnotation will not be performant enough when using large amount of delay annotations. It'll also require implementation of MGMapViewDelegate methods inside NavigationMapView.
@1ec5 if you have any better ideas please let me know.
There was a problem hiding this comment.
@MaximAlien have you seen https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/#layout-symbol-icon-text-fit? Might be useful here.
There was a problem hiding this comment.
/cc @langsmith ^^^ in case we've not considered this for the Android impl.
| /** | ||
| Controls whether delays are shown along the route line. | ||
| */ | ||
| public var showsDelay: Bool = false { |
There was a problem hiding this comment.
For now boolean flag is used to show/hide delay information views. Since delay information is provided for Route, Leg and Step we might want to provide API which allows to show delay for each of those. As per comment here default minimum delay threshold value should be set to 4 minutes.
|
UI part for delay information is not in scope for |
|
Closing this PR in favor of #2734. |
Closing #573.
Current implementation depends on changes in Mapbox Directions. PR can be found here.
Look of initial implementation: